<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>整体配置 | Luckysheet文档</title>
    <meta name="generator" content="VuePress 1.8.0">
    
    <meta name="description" content="Luckysheet ，一款纯前端类似excel的在线表格，功能强大、配置简单、完全开源。本站包含官方配置文档,API,教程。">
    <meta property="article:modified_time" content="2021-01-19T01:33:53.000Z">
    <meta property="og:title" content="整体配置">
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://mengshukeji.github.io/LuckysheetDemo/zh/guide/config.html">
    <meta name="twitter:title" content="整体配置">
    <meta name="twitter:url" content="https://mengshukeji.github.io/LuckysheetDemo/zh/guide/config.html">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:label1" content="Written by">
    
    <link rel="preload" href="/LuckysheetDocs/assets/css/0.styles.58462003.css" as="style"><link rel="preload" href="/LuckysheetDocs/assets/js/app.02d9598d.js" as="script"><link rel="preload" href="/LuckysheetDocs/assets/js/2.daa13025.js" as="script"><link rel="preload" href="/LuckysheetDocs/assets/js/29.1ae5f953.js" as="script"><link rel="prefetch" href="/LuckysheetDocs/assets/js/10.866635ea.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/11.825eabba.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/12.980dcb91.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/13.119fa3a0.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/14.61ea2478.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/15.51a43d85.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/16.de626d16.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/17.e9ae302c.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/18.46d5e5a0.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/19.6ab6bd88.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/20.a4dd0048.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/21.cf5034d8.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/22.c45a4387.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/23.e08fd533.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/24.d1e4369b.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/25.291afc50.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/26.e74f90a6.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/27.1142ecb7.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/28.d6d28da0.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/3.c428902d.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/30.bf70d4f4.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/31.d87cf3af.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/32.a1b6f5f4.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/33.eded6080.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/4.b5e0f872.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/5.e526f9d4.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/6.8106d72b.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/7.c0fe87fd.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/8.abc5c19b.js"><link rel="prefetch" href="/LuckysheetDocs/assets/js/9.2bf3882a.js">
    <link rel="stylesheet" href="/LuckysheetDocs/assets/css/0.styles.58462003.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/LuckysheetDocs/zh/" class="home-link router-link-active"><img src="/LuckysheetDocs/img/logo.png" alt="Luckysheet文档" class="logo"> <span class="site-name can-hide">Luckysheet文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/LuckysheetDocs/zh/" class="nav-link">
  首页
</a></div><div class="nav-item"><a href="/LuckysheetDocs/zh/guide/" class="nav-link router-link-active">
  指南
</a></div><div class="nav-item"><a href="https://mengshukeji.github.io/LuckysheetDemo/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="了解更多" class="mobile-dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/LuckysheetDocs/zh/about/" class="nav-link">
  关于
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="选择语言" class="dropdown-title"><span class="title">选择语言</span> <span class="arrow down"></span></button> <button type="button" aria-label="选择语言" class="mobile-dropdown-title"><span class="title">选择语言</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/LuckysheetDocs/guide/config.html" class="nav-link">
  English
</a></li><li class="dropdown-item"><!----> <a href="/LuckysheetDocs/zh/guide/config.html" aria-current="page" class="nav-link router-link-exact-active router-link-active">
  简体中文
</a></li></ul></div></div> <a href="https://github.com/mengshukeji/Luckysheet" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/LuckysheetDocs/zh/" class="nav-link">
  首页
</a></div><div class="nav-item"><a href="/LuckysheetDocs/zh/guide/" class="nav-link router-link-active">
  指南
</a></div><div class="nav-item"><a href="https://mengshukeji.github.io/LuckysheetDemo/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="了解更多" class="mobile-dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/LuckysheetDocs/zh/about/" class="nav-link">
  关于
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="选择语言" class="dropdown-title"><span class="title">选择语言</span> <span class="arrow down"></span></button> <button type="button" aria-label="选择语言" class="mobile-dropdown-title"><span class="title">选择语言</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/LuckysheetDocs/guide/config.html" class="nav-link">
  English
</a></li><li class="dropdown-item"><!----> <a href="/LuckysheetDocs/zh/guide/config.html" aria-current="page" class="nav-link router-link-exact-active router-link-active">
  简体中文
</a></li></ul></div></div> <a href="https://github.com/mengshukeji/Luckysheet" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav>  <ul class="sidebar-links"><li><a href="/LuckysheetDocs/zh/guide/" aria-current="page" class="sidebar-link">快速上手</a></li><li><a href="/LuckysheetDocs/zh/guide/config.html" aria-current="page" class="active sidebar-link">整体配置</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#基础结构" class="sidebar-link">基础结构</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#配置项" class="sidebar-link">配置项</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#钩子函数" class="sidebar-link">钩子函数</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#单元格" class="sidebar-link">单元格</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#鼠标钩子" class="sidebar-link">鼠标钩子</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#选区操作-包括单元格" class="sidebar-link">选区操作（包括单元格）</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#工作表" class="sidebar-link">工作表</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#工作簿" class="sidebar-link">工作簿</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#图片" class="sidebar-link">图片</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#批注" class="sidebar-link">批注</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#数据透视表" class="sidebar-link">数据透视表</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#冻结" class="sidebar-link">冻结</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#打印" class="sidebar-link">打印</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#旧版钩子函数" class="sidebar-link">旧版钩子函数</a></li><li class="sidebar-sub-header"><a href="/LuckysheetDocs/zh/guide/config.html#分页器" class="sidebar-link">分页器</a></li></ul></li><li><a href="/LuckysheetDocs/zh/guide/sheet.html" class="sidebar-link">工作表配置</a></li><li><a href="/LuckysheetDocs/zh/guide/cell.html" class="sidebar-link">单元格</a></li><li><a href="/LuckysheetDocs/zh/guide/operate.html" class="sidebar-link">表格操作</a></li><li><a href="/LuckysheetDocs/zh/guide/api.html" class="sidebar-link">API</a></li><li><a href="/LuckysheetDocs/zh/guide/resource.html" class="sidebar-link">教程与资源</a></li><li><a href="/LuckysheetDocs/zh/guide/FAQ.html" class="sidebar-link">常见问题</a></li><li><a href="/LuckysheetDocs/zh/guide/contribute.html" class="sidebar-link">贡献指南</a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="整体配置"><a href="#整体配置" class="header-anchor">#</a> 整体配置</h1> <h2 id="基础结构"><a href="#基础结构" class="header-anchor">#</a> 基础结构</h2> <p>初始化表格时，可以设置一个对象配置串<code>options</code>来自定义配置Luckysheet表格。</p> <p>如下是一个简洁的配置案例：</p> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// 配置项</span>
<span class="token keyword">const</span> options <span class="token operator">=</span> <span class="token punctuation">{</span>
    container<span class="token operator">:</span> <span class="token string">'luckysheet'</span><span class="token punctuation">,</span> <span class="token comment">// 设定DOM容器的id</span>
    title<span class="token operator">:</span> <span class="token string">'Luckysheet Demo'</span><span class="token punctuation">,</span> <span class="token comment">// 设定表格名称</span>
    lang<span class="token operator">:</span> <span class="token string">'zh'</span> <span class="token comment">// 设定表格语言</span>

    <span class="token comment">// 更多其他设置...</span>
<span class="token punctuation">}</span>

<span class="token comment">// 初始化表格</span>
luckysheet<span class="token punctuation">.</span><span class="token function">create</span><span class="token punctuation">(</span>options<span class="token punctuation">)</span>
</code></pre></div><p>这里的<code>options</code>配置项会作用于整个表格，特别的，单个sheet的配置则需要在<code>options.data</code>数组中，分别设置对应更详细的参数，参考<a href="/LuckysheetDocs/zh/guide/sheet.html">工作表配置</a></p> <p>针对个性化的需求，除了允许配置信息栏（<a href="#showinfobar">showinfobar</a>）、工具栏（<a href="#showtoolbar">showtoolbar</a>）、底部sheet页（<a href="#showsheetbar">showsheetbar</a>）、底部计数栏（<a href="#showstatisticBar">showstatisticBar</a>）之外，
Luckysheet开放了更细致的自定义配置选项，分别有</p> <ul><li>自定义工具栏（<a href="#showtoolbarConfig">showtoolbarConfig</a>）</li> <li>自定义底部sheet页（<a href="#showsheetbarConfig">showsheetbarConfig</a>）</li> <li>自定义计数栏（<a href="#showstatisticBarConfig">showstatisticBarConfig</a>）</li> <li>自定义单元格右键菜单（<a href="#cellRightClickConfig">cellRightClickConfig</a>）</li> <li>自定义底部sheet页右击菜单（<a href="#sheetRightClickConfig">sheetRightClickConfig</a>）</li></ul> <h2 id="配置项"><a href="#配置项" class="header-anchor">#</a> 配置项</h2> <p>以下为所有支持的设置参数</p> <ul><li>容器ID <a href="#container">container</a></li> <li>工作簿名称 <a href="#title">title</a></li> <li>语言 <a href="#lang">lang</a></li> <li>唯一key <a href="#gridKey">gridKey</a></li> <li>加载整个工作簿 <a href="#loadUrl">loadUrl</a></li> <li>加载其它页celldata <a href="#loadSheetUrl">loadSheetUrl</a></li> <li>允许更新 <a href="#allowUpdate">allowUpdate</a></li> <li>更新地址 <a href="#updateUrl">updateUrl</a></li> <li>缩略图更新地址 <a href="#updateImageUrl">updateImageUrl</a></li> <li>工作表配置 <a href="#data">data</a></li> <li>插件 <a href="#plugins">plugins</a></li> <li>列数 <a href="#column">column</a></li> <li>行数 <a href="#row">row</a></li> <li>亿万格式 <a href="#autoFormatw">autoFormatw</a></li> <li>精度 <a href="#accuracy">accuracy</a></li> <li>允许复制 <a href="#allowCopy">allowCopy</a></li> <li>工具栏 <a href="#showtoolbar">showtoolbar</a></li> <li>自定义工具栏<a href="#showtoolbarConfig">showtoolbarConfig</a></li> <li>信息栏 <a href="#showinfobar">showinfobar</a></li> <li>底部sheet页 <a href="#showsheetbar">showsheetbar</a></li> <li>自定义底部sheet页 <a href="#showsheetbarConfig">showsheetbarConfig</a></li> <li>底部计数栏 <a href="#showstatisticBar">showstatisticBar</a></li> <li>自定义计数栏 <a href="#showstatisticBarConfig">showstatisticBarConfig</a></li> <li>允许添加行 <a href="#enableAddRow">enableAddRow</a></li> <li>允许回到顶部 <a href="#enableAddBackTop">enableAddBackTop</a></li> <li>用户信息 <a href="#userInfo">userInfo</a></li> <li>用户信息菜单 <a href="#userMenuItem">userMenuItem</a></li> <li>返回按钮链接 <a href="#myFolderUrl">myFolderUrl</a></li> <li>比例 <a href="#devicePixelRatio">devicePixelRatio</a></li> <li>功能按钮 <a href="#functionButton">functionButton</a></li> <li>自动缩进界面 <a href="#showConfigWindowResize">showConfigWindowResize</a></li> <li>刷新公式 <a href="#forceCalculation">forceCalculation</a></li> <li>自定义单元格右键菜单 <a href="#cellRightClickConfig">cellRightClickConfig</a></li> <li>自定义sheet页右击菜单 <a href="#sheetRightClickConfig">sheetRightClickConfig</a></li> <li>行标题区域的宽度 <a href="#rowHeaderWidth">rowHeaderWidth</a></li> <li>列标题区域的高度 <a href="#columnHeaderHeight">columnHeaderHeight</a></li> <li>是否显示公式栏 <a href="#sheetFormulaBar">sheetFormulaBar</a></li> <li>初始化默认字体大小 <a href="#defaultFontSize">defaultFontSize</a></li> <li>是否限制工作表名长度 <a href="#limitSheetNameLength">limitSheetNameLength</a></li> <li>默认允许工作表名的最大长度 <a href="#defaultSheetNameMaxLength">defaultSheetNameMaxLength</a></li> <li>分页器 <a href="#pager">pager</a></li></ul> <h3 id="container"><a href="#container" class="header-anchor">#</a> container</h3> <ul><li>类型：String</li> <li>默认值：&quot;luckysheet&quot;</li> <li>作用：容器的ID</li></ul> <hr> <h3 id="title"><a href="#title" class="header-anchor">#</a> title</h3> <ul><li>类型：String</li> <li>默认值：&quot;Luckysheet Demo&quot;</li> <li>作用：工作簿名称</li></ul> <hr> <h3 id="lang"><a href="#lang" class="header-anchor">#</a> lang</h3> <ul><li>类型：String</li> <li>默认值：&quot;en&quot;</li> <li>作用：国际化设置，允许设置表格的语言，支持简体中文(&quot;zh&quot;)、英文(&quot;en&quot;)、繁体中文(&quot;zh_tw&quot;)和西班牙文(&quot;es&quot;)</li></ul> <hr> <h3 id="gridkey"><a href="#gridkey" class="header-anchor">#</a> gridKey</h3> <ul><li>类型：String</li> <li>默认值：&quot;&quot;</li> <li>作用：表格唯一标识符</li></ul> <hr> <h3 id="loadurl"><a href="#loadurl" class="header-anchor">#</a> loadUrl</h3> <ul><li><p>类型：String</p></li> <li><p>默认值：&quot;&quot;</p></li> <li><p>作用：配置<code>loadUrl</code>接口地址，加载所有工作表的配置，并包含当前页单元格数据，与<code>loadSheetUrl</code>配合使用。参数为<code>gridKey</code>（表格主键）。</p> <p>源码的请求写法是：</p> <div class="language-js extra-class"><pre class="language-js"><code>$<span class="token punctuation">.</span><span class="token function">post</span><span class="token punctuation">(</span>loadurl<span class="token punctuation">,</span> <span class="token punctuation">{</span><span class="token string">&quot;gridKey&quot;</span> <span class="token operator">:</span> server<span class="token punctuation">.</span>gridKey<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token parameter">d</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre></div><blockquote><p>参见源码 <a href="https://github.com/mengshukeji/Luckysheet/blob/master/src/core.js" target="_blank" rel="noopener noreferrer"><code>src/core.js</code><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p></blockquote> <p>Luckysheet会通过ajax请求（POST）整个表格的数据，默认载入status为1的sheet数据中的<code>celldata</code>，其余的sheet载入除<code>celldata</code>字段外的所有配置字段。特别是在数据量大的时候，<code>loadUrl</code>只负责当前页单元格数据，配置<code>loadSheetUrl</code>作为其它工作表异步加载单元格数据的接口，可以提高性能。</p> <p>一个合格的接口返回的json字符串数据为：</p> <div class="language-js extra-class"><pre class="language-js"><code>&quot;<span class="token punctuation">[</span>	
	<span class="token comment">//status为1的sheet页，重点是需要提供初始化的数据celldata</span>
	<span class="token punctuation">{</span>
		<span class="token string">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Cell&quot;</span><span class="token punctuation">,</span>
		<span class="token string">&quot;index&quot;</span><span class="token operator">:</span> <span class="token string">&quot;sheet_01&quot;</span><span class="token punctuation">,</span>
		<span class="token string">&quot;order&quot;</span><span class="token operator">:</span>  <span class="token number">0</span><span class="token punctuation">,</span>
		<span class="token string">&quot;status&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
		<span class="token string">&quot;celldata&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span><span class="token string">&quot;r&quot;</span><span class="token operator">:</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string">&quot;c&quot;</span><span class="token operator">:</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string">&quot;v&quot;</span><span class="token operator">:</span><span class="token punctuation">{</span><span class="token string">&quot;v&quot;</span><span class="token operator">:</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token string">&quot;m&quot;</span><span class="token operator">:</span><span class="token string">&quot;1&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;ct&quot;</span><span class="token operator">:</span><span class="token punctuation">{</span><span class="token string">&quot;fa&quot;</span><span class="token operator">:</span><span class="token string">&quot;General&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;t&quot;</span><span class="token operator">:</span><span class="token string">&quot;n&quot;</span><span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token punctuation">]</span>
	<span class="token punctuation">}</span><span class="token punctuation">,</span>
	<span class="token comment">//其他status为0的sheet页，无需提供celldata，只需要配置项即可</span>
	<span class="token punctuation">{</span>
		<span class="token string">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Data&quot;</span><span class="token punctuation">,</span>
		<span class="token string">&quot;index&quot;</span><span class="token operator">:</span> <span class="token string">&quot;sheet_02&quot;</span><span class="token punctuation">,</span>
		<span class="token string">&quot;order&quot;</span><span class="token operator">:</span>  <span class="token number">1</span><span class="token punctuation">,</span>
		<span class="token string">&quot;status&quot;</span><span class="token operator">:</span> <span class="token number">0</span>
	<span class="token punctuation">}</span><span class="token punctuation">,</span>
	<span class="token punctuation">{</span>
		<span class="token string">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Picture&quot;</span><span class="token punctuation">,</span>
		<span class="token string">&quot;index&quot;</span><span class="token operator">:</span> <span class="token string">&quot;sheet_03&quot;</span><span class="token punctuation">,</span>
		<span class="token string">&quot;order&quot;</span><span class="token operator">:</span>  <span class="token number">2</span><span class="token punctuation">,</span>
		<span class="token string">&quot;status&quot;</span><span class="token operator">:</span> <span class="token number">0</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">]</span>&quot;
</code></pre></div><p>有几个注意点</p> <ul><li>这是一个字符串，类似于JSON.stringify()处理后的json数据，压缩后的数据便于传输</li> <li>loadUrl是一个post请求，也是为了支持大数据量</li> <li>考虑到一些公式、图表及数据透视表会引用其他sheet的数据，所以前台会加一个判断，如果该当前sheet引用了其他sheet的数据则会通过<code>loadSheetUrl</code>配置的接口地址请求数据，把引用到的sheet的数据一并补全，而不用等切换到其它页的时候再请求</li> <li>当数据量小的时候，也可以不用Luckysheet提供的此接口，直接使用<a href="#data">data</a>参数可以提前准备好所有表格数据用于初始化</li></ul></li></ul> <hr> <h3 id="loadsheeturl"><a href="#loadsheeturl" class="header-anchor">#</a> loadSheetUrl</h3> <ul><li><p>类型：String</p></li> <li><p>默认值：&quot;&quot;</p></li> <li><p>作用：配置<code>loadSheetUrl</code>接口地址，用于异步加载其它单元格数据。参数为<code>gridKey</code>（表格主键） 和 <code>index</code>（sheet主键合集，格式为<code>[&quot;sheet_01&quot;,&quot;sheet_02&quot;,&quot;sheet_03&quot;]</code>）。</p> <p>源码的请求写法是：</p> <div class="language-js extra-class"><pre class="language-js"><code>$<span class="token punctuation">.</span><span class="token function">post</span><span class="token punctuation">(</span>loadSheetUrl<span class="token punctuation">,</span> <span class="token punctuation">{</span><span class="token string">&quot;gridKey&quot;</span> <span class="token operator">:</span> server<span class="token punctuation">.</span>gridKey<span class="token punctuation">,</span> <span class="token string">&quot;index&quot;</span><span class="token operator">:</span> sheetindex<span class="token punctuation">.</span><span class="token function">join</span><span class="token punctuation">(</span><span class="token string">&quot;,&quot;</span><span class="token punctuation">)</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token parameter">d</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre></div><blockquote><p>参见源码 <a href="https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/sheetmanage.js" target="_blank" rel="noopener noreferrer"><code>src/controllers/sheetmanage.js</code><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p></blockquote> <p>返回的数据为sheet的<code>celldata</code>字段数据集合。</p> <p>一个合格的接口返回的json字符串数据为：</p> <div class="language-js extra-class"><pre class="language-js"><code>&quot;<span class="token punctuation">{</span>
	<span class="token string">&quot;sheet_01&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
		<span class="token punctuation">{</span>
			<span class="token string">&quot;r&quot;</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
			<span class="token string">&quot;c&quot;</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
			<span class="token string">&quot;v&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token string">&quot;v&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token string">&quot;m&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;ct&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token string">&quot;fa&quot;</span><span class="token operator">:</span> <span class="token string">&quot;General&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;t&quot;</span><span class="token operator">:</span> <span class="token string">&quot;n&quot;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">]</span><span class="token punctuation">,</span>
	<span class="token string">&quot;sheet_02&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
		<span class="token punctuation">{</span>
			<span class="token string">&quot;r&quot;</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
			<span class="token string">&quot;c&quot;</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
			<span class="token string">&quot;v&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token string">&quot;v&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token string">&quot;m&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;ct&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token string">&quot;fa&quot;</span><span class="token operator">:</span> <span class="token string">&quot;General&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;t&quot;</span><span class="token operator">:</span> <span class="token string">&quot;n&quot;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">]</span><span class="token punctuation">,</span>
	<span class="token string">&quot;sheet_03&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
		<span class="token punctuation">{</span>
			<span class="token string">&quot;r&quot;</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
			<span class="token string">&quot;c&quot;</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
			<span class="token string">&quot;v&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token string">&quot;v&quot;</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token string">&quot;m&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;ct&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token string">&quot;fa&quot;</span><span class="token operator">:</span> <span class="token string">&quot;General&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;t&quot;</span><span class="token operator">:</span> <span class="token string">&quot;n&quot;</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">]</span>
<span class="token punctuation">}</span>&quot;
</code></pre></div><p>同<code>loadUrl</code>类似，<code>loadSheetUrl</code>也要注意这几点：</p> <ul><li>这是一个字符串格式数据</li> <li>这是一个post请求</li> <li>这个接口会在两种情况下自动调用，一是在<code>loadUrl</code>加载的当前页数据时发现当前工作表引用了其他工作表，二是切换到一个未曾加载过数据的工作表时</li></ul></li></ul> <hr> <h3 id="allowupdate"><a href="#allowupdate" class="header-anchor">#</a> allowUpdate</h3> <ul><li>类型：Boolean</li> <li>默认值：false</li> <li>作用：是否允许操作表格后的后台更新，与<code>updateUrl</code>配合使用。如果要开启共享编辑，此参数必须设置为<code>true</code>。</li></ul> <hr> <h3 id="updateurl"><a href="#updateurl" class="header-anchor">#</a> updateUrl</h3> <ul><li><p>类型：String</p></li> <li><p>默认值：&quot;&quot;</p></li> <li><p>作用：操作表格后，实时保存数据的websocket地址，此接口也是共享编辑的接口地址。</p> <p>有个注意点，要想开启共享编辑，必须满足以下3个条件：</p> <ul><li><code>allowUpdate</code>为<code>true</code></li> <li>配置了<code>loadUrl</code></li> <li>配置了<code>updateUrl</code></li></ul> <p>注意，发送给后端的数据默认是经过pako压缩过后的。后台拿到数据需要先解压。</p> <p>通过共享编辑功能，可以实现Luckysheet实时保存数据和多人同步数据，每一次操作都会发送不同的参数到后台，具体的操作类型和参数参见<a href="/LuckysheetDocs/zh/guide/operate.html">表格操作</a></p></li></ul> <hr> <h3 id="updateimageurl"><a href="#updateimageurl" class="header-anchor">#</a> updateImageUrl</h3> <ul><li>类型：String</li> <li>默认值：&quot;&quot;</li> <li>作用：缩略图的更新地址</li></ul> <hr> <h3 id="data"><a href="#data" class="header-anchor">#</a> data</h3> <ul><li>类型：Array</li> <li>默认值：[{ &quot;name&quot;: &quot;Sheet1&quot;, color: &quot;&quot;, &quot;status&quot;: &quot;1&quot;, &quot;order&quot;: &quot;0&quot;, &quot;data&quot;: [], &quot;config&quot;: {}, &quot;index&quot;:0 }, { &quot;name&quot;: &quot;Sheet2&quot;, color: &quot;&quot;, &quot;status&quot;: &quot;0&quot;, &quot;order&quot;: &quot;1&quot;, &quot;data&quot;: [], &quot;config&quot;: {}, &quot;index&quot;:1  }, { &quot;name&quot;: &quot;Sheet3&quot;, color: &quot;&quot;, &quot;status&quot;: &quot;0&quot;, &quot;order&quot;: &quot;2&quot;, &quot;data&quot;: [], &quot;config&quot;: {}, &quot;index&quot;:2  }]</li> <li>作用：当未配置<code>loadUrl</code>和<code>loadSheetUrl</code>的时候，需要手动配置传入整个客户端所有sheet数据<code>[shee1, sheet2, sheet3]</code>，详细参数设置参见<a href="/LuckysheetDocs/zh/guide/sheet.html">工作表配置</a></li></ul> <hr> <h3 id="plugins"><a href="#plugins" class="header-anchor">#</a> plugins</h3> <ul><li>类型：Array</li> <li>默认值：[]</li> <li>作用：配置插件，支持图表：&quot;chart&quot;</li></ul> <hr> <h3 id="column"><a href="#column" class="header-anchor">#</a> column</h3> <ul><li>类型：Number</li> <li>默认值：60</li> <li>作用：空表格默认的列数量</li></ul> <hr> <h3 id="row"><a href="#row" class="header-anchor">#</a> row</h3> <ul><li>类型：Number</li> <li>默认值：84</li> <li>作用：空表格默认的行数据量</li></ul> <hr> <h3 id="autoformatw"><a href="#autoformatw" class="header-anchor">#</a> autoFormatw</h3> <ul><li>类型：Boolean</li> <li>默认值：false</li> <li>作用：自动格式化超过4位数的数字为‘亿万格式’，例：true or &quot;true&quot; or &quot;TRUE&quot;</li></ul> <hr> <h3 id="accuracy"><a href="#accuracy" class="header-anchor">#</a> accuracy</h3> <ul><li>类型：Number</li> <li>默认值：undefined</li> <li>作用：设置精度，小数点后的位数。传参数为数字或数字字符串，例： &quot;0&quot; 或 0</li></ul> <hr> <h3 id="allowcopy"><a href="#allowcopy" class="header-anchor">#</a> allowCopy</h3> <ul><li>类型：Boolean</li> <li>默认值：true</li> <li>作用：是否允许拷贝</li></ul> <hr> <h3 id="showtoolbar"><a href="#showtoolbar" class="header-anchor">#</a> showtoolbar</h3> <ul><li>类型：Boolean</li> <li>默认值：true</li> <li>作用：是否显示工具栏</li></ul> <hr> <h3 id="showtoolbarconfig"><a href="#showtoolbarconfig" class="header-anchor">#</a> showtoolbarConfig</h3> <ul><li>类型：Object</li> <li>默认值：{}</li> <li>作用：自定义配置工具栏，可以与showtoolbar配合使用，<code>showtoolbarConfig</code>拥有更高的优先级。</li> <li>格式：<div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    undoRedo<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//撤销重做，注意撤消重做是两个按钮，由这一个配置决定显示还是隐藏</span>
    paintFormat<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//格式刷</span>
    currencyFormat<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//货币格式</span>
    percentageFormat<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//百分比格式</span>
    numberDecrease<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '减少小数位数'</span>
    numberIncrease<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '增加小数位数</span>
    moreFormats<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '更多格式'</span>
    font<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '字体'</span>
    fontSize<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '字号大小'</span>
    bold<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '粗体 (Ctrl+B)'</span>
    italic<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '斜体 (Ctrl+I)'</span>
	strikethrough<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '删除线 (Alt+Shift+5)'</span>
	underline<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '下划线 (Alt+Shift+6)'</span>
    textColor<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '文本颜色'</span>
    fillColor<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '单元格颜色'</span>
    border<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '边框'</span>
    mergeCell<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '合并单元格'</span>
    horizontalAlignMode<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '水平对齐方式'</span>
    verticalAlignMode<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '垂直对齐方式'</span>
    textWrapMode<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '换行方式'</span>
    textRotateMode<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '文本旋转方式'</span>
	image<span class="token operator">:</span><span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '插入图片'</span>
	link<span class="token operator">:</span><span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '插入链接'</span>
    chart<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '图表'（图标隐藏，但是如果配置了chart插件，右击仍然可以新建图表）</span>
    postil<span class="token operator">:</span>  <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//'批注'</span>
    pivotTable<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>  <span class="token comment">//'数据透视表'</span>
    function<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '公式'</span>
    frozenMode<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '冻结方式'</span>
    sortAndFilter<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '排序和筛选'</span>
    conditionalFormat<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '条件格式'</span>
	dataVerification<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '数据验证'</span>
    splitColumn<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '分列'</span>
    screenshot<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '截图'</span>
    findAndReplace<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '查找替换'</span>
	protection<span class="token operator">:</span><span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '工作表保护'</span>
	print<span class="token operator">:</span><span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// '打印'</span>
<span class="token punctuation">}</span>
</code></pre></div></li> <li>示例：
<ul><li><p>仅显示撤消重做和字体按钮：</p> <div class="language-js extra-class"><pre class="language-js"><code>	<span class="token comment">//options</span>
	<span class="token punctuation">{</span>
		showtoolbar<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
		showtoolbarConfig<span class="token operator">:</span><span class="token punctuation">{</span>
			undoRedo<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
			font<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
</code></pre></div></li> <li><p>仅隐藏图片和打印按钮：</p> <div class="language-js extra-class"><pre class="language-js"><code>	<span class="token comment">//options</span>
	<span class="token punctuation">{</span>
		showtoolbar<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 默认就是true，可以不设置</span>
		showtoolbarConfig<span class="token operator">:</span><span class="token punctuation">{</span>
			image<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
			print<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
</code></pre></div></li></ul></li></ul> <hr> <h3 id="showinfobar"><a href="#showinfobar" class="header-anchor">#</a> showinfobar</h3> <ul><li>类型：Boolean</li> <li>默认值：true</li> <li>作用：是否显示顶部信息栏</li></ul> <hr> <h3 id="showsheetbar"><a href="#showsheetbar" class="header-anchor">#</a> showsheetbar</h3> <ul><li>类型：Boolean</li> <li>默认值：true</li> <li>作用：是否显示底部sheet页按钮</li></ul> <hr> <h3 id="showsheetbarconfig"><a href="#showsheetbarconfig" class="header-anchor">#</a> showsheetbarConfig</h3> <ul><li>类型：Object</li> <li>默认值：{}</li> <li>作用：自定义配置底部sheet页按钮，可以与showsheetbar配合使用，<code>showsheetbarConfig</code>拥有更高的优先级。</li> <li>格式：<div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    add<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//新增sheet  </span>
    menu<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//sheet管理菜单</span>
    sheet<span class="token operator">:</span> <span class="token boolean">false</span> <span class="token comment">//sheet页显示</span>
<span class="token punctuation">}</span>
</code></pre></div></li> <li>示例：
<ul><li><p>仅显示新增sheet按钮：</p> <div class="language-js extra-class"><pre class="language-js"><code>	<span class="token comment">//options</span>
	<span class="token punctuation">{</span>
		showsheetbar<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
		showsheetbarConfig<span class="token operator">:</span><span class="token punctuation">{</span>
			add<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
</code></pre></div></li> <li><p>仅隐藏新增sheet和管理按钮：</p> <div class="language-js extra-class"><pre class="language-js"><code>	<span class="token comment">//options</span>
	<span class="token punctuation">{</span>
		showsheetbar<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 默认就是true，可以不设置</span>
		showsheetbarConfig<span class="token operator">:</span><span class="token punctuation">{</span>
			add<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
			menu<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
</code></pre></div></li></ul></li></ul> <hr> <h3 id="showstatisticbar"><a href="#showstatisticbar" class="header-anchor">#</a> showstatisticBar</h3> <ul><li>类型：Boolean</li> <li>默认值：true</li> <li>作用：是否显示底部计数栏</li></ul> <hr> <h3 id="showstatisticbarconfig"><a href="#showstatisticbarconfig" class="header-anchor">#</a> showstatisticBarConfig</h3> <ul><li>类型：Object</li> <li>默认值：{}</li> <li>作用：自定义配置底部计数栏，可以与showstatisticBar配合使用，<code>showstatisticBarConfig</code>拥有更高的优先级。</li> <li>格式：<div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    count<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 计数栏</span>
	view<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 打印视图</span>
    zoom<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 缩放</span>
<span class="token punctuation">}</span>
</code></pre></div></li> <li>示例：
<ul><li><p>仅显示缩放按钮：</p> <div class="language-js extra-class"><pre class="language-js"><code>	<span class="token comment">//options</span>
	<span class="token punctuation">{</span>
		showstatisticBar<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
		showstatisticBarConfig<span class="token operator">:</span><span class="token punctuation">{</span>
			zoom<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
</code></pre></div></li> <li><p>仅隐藏打印视图按钮：</p> <div class="language-js extra-class"><pre class="language-js"><code>	<span class="token comment">//options</span>
	<span class="token punctuation">{</span>
		showstatisticBar<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 默认就是true，可以不设置</span>
		showstatisticBarConfig<span class="token operator">:</span><span class="token punctuation">{</span>
			view<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
</code></pre></div></li></ul></li></ul> <hr> <h3 id="enableaddrow"><a href="#enableaddrow" class="header-anchor">#</a> enableAddRow</h3> <ul><li>类型：Boolean</li> <li>默认值：true</li> <li>作用：允许添加行</li></ul> <hr> <h3 id="enableaddbacktop"><a href="#enableaddbacktop" class="header-anchor">#</a> enableAddBackTop</h3> <ul><li>类型：Boolean</li> <li>默认值：true</li> <li>作用：允许回到顶部</li></ul> <hr> <h3 id="userinfo"><a href="#userinfo" class="header-anchor">#</a> userInfo</h3> <ul><li><p>类型：String | Boolean | Object</p></li> <li><p>默认值：false</p></li> <li><p>作用：右上角的用户信息展示样式，支持以下三种形式</p> <ol><li>HTML模板字符串，如：</li></ol> <div class="language-js extra-class"><pre class="language-js"><code>options<span class="token operator">:</span><span class="token punctuation">{</span>
	<span class="token comment">// 其他配置</span>
	userInfo<span class="token operator">:</span><span class="token string">'&lt;i style=&quot;font-size:16px;color:#ff6a00;&quot; class=&quot;fa fa-taxi&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt; Lucky'</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre></div><p>或者一个普通字符串，如：</p> <div class="language-js extra-class"><pre class="language-js"><code>options<span class="token operator">:</span><span class="token punctuation">{</span>
	<span class="token comment">// 其他配置</span>
	userInfo<span class="token operator">:</span><span class="token string">'Lucky'</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre></div><ol start="2"><li>Boolean类型，如：</li></ol> <p><code>false</code>:不展示</p> <div class="language-js extra-class"><pre class="language-js"><code>options<span class="token operator">:</span><span class="token punctuation">{</span>
	<span class="token comment">// 其他配置</span>
	userInfo<span class="token operator">:</span><span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 不展示用户信息</span>
<span class="token punctuation">}</span>

</code></pre></div><p><code>ture</code>:展示默认的字符串</p> <div class="language-js extra-class"><pre class="language-js"><code>options<span class="token operator">:</span><span class="token punctuation">{</span>
	<span class="token comment">// 其他配置</span>
	userInfo<span class="token operator">:</span><span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 展示HTML:'&lt;i style=&quot;font-size:16px;color:#ff6a00;&quot; class=&quot;fa fa-taxi&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt; Lucky'</span>
<span class="token punctuation">}</span>

</code></pre></div><ol start="3"><li>对象格式，设置 <code>userImage</code>：用户头像地址 和 <code>userName</code>：用户名，如：</li></ol> <div class="language-js extra-class"><pre class="language-js"><code>options<span class="token operator">:</span><span class="token punctuation">{</span>
	<span class="token comment">// 其他配置</span>
	userImage<span class="token operator">:</span><span class="token string">'https://cdn.jsdelivr.net/npm/luckyresources@1.0.3/assets/img/logo/logo.png'</span><span class="token punctuation">,</span> <span class="token comment">// 头像url</span>
	userName<span class="token operator">:</span><span class="token string">'Lucky'</span><span class="token punctuation">,</span> <span class="token comment">// 用户名</span>
<span class="token punctuation">}</span>
</code></pre></div><ol start="4"><li>注意，设置为<code>undefined</code>或者不设置，同设置<code>false</code></li></ol></li></ul> <hr> <h3 id="usermenuitem"><a href="#usermenuitem" class="header-anchor">#</a> userMenuItem</h3> <ul><li>类型：Array</li> <li>默认值：<code>[{url:&quot;www.baidu.com&quot;, &quot;icon&quot;:'&lt;i class=&quot;fa fa-folder&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt;', &quot;name&quot;:&quot;我的表格&quot;}, {url:&quot;www.baidu.com&quot;, &quot;icon&quot;:'&lt;i class=&quot;fa fa-sign-out&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt;', &quot;name&quot;:&quot;退出登陆&quot;}]</code></li> <li>作用：点击右上角的用户信息弹出的菜单</li></ul> <hr> <h3 id="myfolderurl"><a href="#myfolderurl" class="header-anchor">#</a> myFolderUrl</h3> <ul><li>类型：String</li> <li>默认值：&quot;www.baidu.com&quot;</li> <li>作用：左上角&lt;返回按钮的链接</li></ul> <hr> <h3 id="devicepixelratio"><a href="#devicepixelratio" class="header-anchor">#</a> devicePixelRatio</h3> <ul><li>类型：Number</li> <li>默认值：window.devicePixelRatio</li> <li>作用：设备比例，比例越大表格分辨率越高</li></ul> <hr> <h3 id="functionbutton"><a href="#functionbutton" class="header-anchor">#</a> functionButton</h3> <ul><li>类型：String</li> <li>默认值：&quot;&quot;</li> <li>作用：右上角功能按钮，例如<code>'&lt;button id=&quot;&quot; class=&quot;btn btn-primary&quot; style=&quot;padding:3px 6px;font-size: 12px;margin-right: 10px;&quot;&gt;下载&lt;/button&gt; &lt;button id=&quot;&quot; class=&quot;btn btn-primary btn-danger&quot; style=&quot; padding:3px 6px; font-size: 12px; margin-right: 10px;&quot;&gt;分享&lt;/button&gt; &lt;button id=&quot;luckysheet-share-btn-title&quot; class=&quot;btn btn-primary btn-danger&quot; style=&quot; padding:3px 6px; font-size: 12px; margin-right: 10px;&quot;&gt;秀数据&lt;/button&gt;'</code></li></ul> <hr> <h3 id="showconfigwindowresize"><a href="#showconfigwindowresize" class="header-anchor">#</a> showConfigWindowResize</h3> <ul><li>类型：Boolean</li> <li>默认值：true</li> <li>作用：图表或数据透视表的配置会在右侧弹出，设置弹出后表格是否会自动缩进</li></ul> <hr> <h3 id="forcecalculation"><a href="#forcecalculation" class="header-anchor">#</a> forceCalculation</h3> <ul><li><p>类型：Boolean</p></li> <li><p>默认值：false</p></li> <li><p>作用：强制刷新公式。</p> <p>默认情况下，为提高加载性能，表格初始化的时候，含有公式的单元格会默认直接取得<code>v</code>和<code>m</code>作为数据结果，而不做实时计算。</p> <p>如果公式关联到的单元格数据已经变化，或者公式所在的单元格数据结果改变了，则会导致关联单元格应该计算得出的结果和实际显示结果不一致，这是就需要开启公式刷新，保证数据实时计算的准确性。</p> <p>⚠️提醒，公式较多时会有性能问题，慎用！</p></li></ul> <hr> <h3 id="cellrightclickconfig"><a href="#cellrightclickconfig" class="header-anchor">#</a> cellRightClickConfig</h3> <ul><li><p>类型：Object</p></li> <li><p>默认值：{}</p></li> <li><p>作用：自定义配置单元格右击菜单</p></li> <li><p>格式：</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    copy<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 复制</span>
    copyAs<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 复制为</span>
    paste<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 粘贴</span>
    insertRow<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 插入行</span>
    insertColumn<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 插入列</span>
    deleteRow<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 删除选中行</span>
    deleteColumn<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 删除选中列</span>
    deleteCell<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 删除单元格</span>
    hideRow<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 隐藏选中行和显示选中行</span>
    hideColumn<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 隐藏选中列和显示选中列</span>
    rowHeight<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 行高</span>
    columnWidth<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 列宽</span>
    clear<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 清除内容</span>
    matrix<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 矩阵操作选区</span>
    sort<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 排序选区</span>
    filter<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 筛选选区</span>
    chart<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 图表生成</span>
    image<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 插入图片</span>
    link<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 插入链接</span>
    data<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 数据验证</span>
	cellFormat<span class="token operator">:</span> <span class="token boolean">false</span> <span class="token comment">// 设置单元格格式</span>
<span class="token punctuation">}</span>
</code></pre></div><p>除了单元格，这里的配置还包括行标题右击菜单、列标题右击菜单和列标题下拉箭头的菜单，具体配置关系如下表格：</p> <table><thead><tr><th>右击菜单配置</th> <th>单元格</th> <th>行标题</th> <th>列标题</th> <th>列箭头</th></tr></thead> <tbody><tr><td>copy</td> <td>复制</td> <td>复制</td> <td>复制</td> <td>复制</td></tr> <tr><td>copyAs</td> <td>复制为</td> <td>复制为</td> <td>复制为</td> <td>复制为</td></tr> <tr><td>paste</td> <td>粘贴</td> <td>粘贴</td> <td>粘贴</td> <td>粘贴</td></tr> <tr><td>insertRow</td> <td>插入行</td> <td>向上增加N行，向下增加N行</td> <td>-</td> <td>-</td></tr> <tr><td>insertColumn</td> <td>插入列</td> <td>-</td> <td>向左增加N列，向右增加N列</td> <td>向左增加N列，向右增加N列</td></tr> <tr><td>deleteRow</td> <td>删除选中行</td> <td>删除选中行</td> <td>-</td> <td>-</td></tr> <tr><td>deleteColumn</td> <td>删除选中列</td> <td>-</td> <td>删除选中列</td> <td>删除选中列</td></tr> <tr><td>deleteCell</td> <td>删除单元格</td> <td>-</td> <td>-</td> <td>-</td></tr> <tr><td>hideRow</td> <td>-</td> <td>隐藏选中行和显示选中行</td> <td>-</td> <td>-</td></tr> <tr><td>hideColumn</td> <td>-</td> <td>-</td> <td>隐藏选中列和显示选中列</td> <td>隐藏选中列和显示选中列</td></tr> <tr><td>rowHeight</td> <td>-</td> <td>行高</td> <td>-</td> <td>-</td></tr> <tr><td>columnWidth</td> <td>-</td> <td>-</td> <td>列宽</td> <td>列宽</td></tr> <tr><td>clear</td> <td>清除内容</td> <td>清除内容</td> <td>清除内容</td> <td>-</td></tr> <tr><td>matrix</td> <td>矩阵操作选区</td> <td>矩阵操作选区</td> <td>矩阵操作选区</td> <td>-</td></tr> <tr><td>sort</td> <td>排序选区</td> <td>排序选区</td> <td>排序选区</td> <td>A-Z排序和Z-A排序</td></tr> <tr><td>filter</td> <td>筛选选区</td> <td>筛选选区</td> <td>筛选选区</td> <td>-</td></tr> <tr><td>chart</td> <td>图表生成</td> <td>图表生成</td> <td>图表生成</td> <td>-</td></tr> <tr><td>image</td> <td>插入图片</td> <td>插入图片</td> <td>插入图片</td> <td>-</td></tr> <tr><td>link</td> <td>插入链接</td> <td>插入链接</td> <td>插入链接</td> <td>-</td></tr> <tr><td>data</td> <td>数据验证</td> <td>数据验证</td> <td>数据验证</td> <td>-</td></tr> <tr><td>cellFormat</td> <td>设置单元格格式</td> <td>设置单元格格式</td> <td>设置单元格格式</td> <td>-</td></tr></tbody></table></li></ul> <hr> <h3 id="sheetrightclickconfig"><a href="#sheetrightclickconfig" class="header-anchor">#</a> sheetRightClickConfig</h3> <ul><li>类型：Object</li> <li>默认值：{}</li> <li>作用：自定义配置sheet页右击菜单</li> <li>格式：<div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>   
    delete<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 删除</span>
    copy<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 复制</span>
    rename<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//重命名</span>
    color<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//更改颜色</span>
    hide<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//隐藏，取消隐藏</span>
    move<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//向左移，向右移</span>
<span class="token punctuation">}</span>

</code></pre></div></li></ul> <hr> <h3 id="rowheaderwidth"><a href="#rowheaderwidth" class="header-anchor">#</a> rowHeaderWidth</h3> <ul><li>类型：Number</li> <li>默认值：46</li> <li>作用：行标题区域的宽度，如果设置为0，则表示隐藏行标题</li></ul> <hr> <h3 id="columnheaderheight"><a href="#columnheaderheight" class="header-anchor">#</a> columnHeaderHeight</h3> <ul><li>类型：Number</li> <li>默认值：20</li> <li>作用：列标题区域的高度，如果设置为0，则表示隐藏列标题</li></ul> <hr> <h3 id="sheetformulabar"><a href="#sheetformulabar" class="header-anchor">#</a> sheetFormulaBar</h3> <ul><li>类型：Boolean</li> <li>默认值：true</li> <li>作用：是否显示公式栏</li></ul> <hr> <h3 id="defaultfontsize"><a href="#defaultfontsize" class="header-anchor">#</a> defaultFontSize</h3> <ul><li>类型：Number</li> <li>默认值：11</li> <li>作用：初始化默认字体大小</li></ul> <hr> <h3 id="limitsheetnamelength"><a href="#limitsheetnamelength" class="header-anchor">#</a> limitSheetNameLength</h3> <ul><li>类型：Boolean</li> <li>默认值：true</li> <li>作用：工作表重命名等场景下是否限制工作表名称的长度</li></ul> <hr> <h3 id="defaultsheetnamemaxlength"><a href="#defaultsheetnamemaxlength" class="header-anchor">#</a> defaultSheetNameMaxLength</h3> <ul><li>类型：Number</li> <li>默认值：31</li> <li>作用：默认允许的工作表名最大长度</li></ul> <hr> <h3 id="pager"><a href="#pager" class="header-anchor">#</a> pager</h3> <ul><li>类型：Object</li> <li>默认值：null</li> <li>作用：分页器按钮设置，初版方案是直接使用的jquery插件 <a href="https://github.com/jvbei/sPage" target="_blank" rel="noopener noreferrer">sPage<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>
点击分页按钮会触发钩子函数 <code>onTogglePager</code>，返回当前页码，同<code>sPage</code>的<code>backFun</code>方法，此分页器设置只负责UI部分，具体切换分页后的数据请求和数据渲染，请在<code>onTogglePager</code>钩子行数里自定义处理。<div class="language-js extra-class"><pre class="language-js"><code>pager<span class="token operator">:</span> <span class="token punctuation">{</span>
	pageIndex<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token comment">//当前的页码</span>
	pageSize<span class="token operator">:</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token comment">//每页显示多少行数据</span>
	total<span class="token operator">:</span> <span class="token number">50</span><span class="token punctuation">,</span> <span class="token comment">//数据总行数</span>
	selectOption<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">]</span> <span class="token comment">//允许设置每页行数的选项</span>
<span class="token punctuation">}</span>
</code></pre></div></li></ul> <hr> <h2 id="钩子函数"><a href="#钩子函数" class="header-anchor">#</a> 钩子函数</h2> <p>钩子函数应用于二次开发时，会在各个常用鼠标或者键盘操作时植入钩子，调用开发者传入的函数，起到扩展Luckysheet功能的作用。</p> <p>钩子函数统一配置在<code>options.hook</code>下，可以分别针对单元格、sheet页、表格创建配置hook。</p> <blockquote><p>使用案例可参考源码 <a href="https://github.com/mengshukeji/Luckysheet/blob/master/src/index.html" target="_blank" rel="noopener noreferrer">src/index.html<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p></blockquote> <h2 id="单元格"><a href="#单元格" class="header-anchor">#</a> 单元格</h2> <h3 id="celleditbefore"><a href="#celleditbefore" class="header-anchor">#</a> cellEditBefore</h3> <ul><li><p>类型：Function</p></li> <li><p>默认值：null</p></li> <li><p>作用：进入单元格编辑模式之前触发。在选中了某个单元格且在非编辑状态下，通常有以下三种常规方法触发进入编辑模式</p> <ul><li>双击单元格</li> <li>敲Enter键</li> <li>使用API：enterEditMode</li></ul></li> <li><p>参数：</p> <ul><li>{Array} [range]: 当前选区范围</li></ul></li></ul> <hr> <h3 id="cellupdatebefore"><a href="#cellupdatebefore" class="header-anchor">#</a> cellUpdateBefore</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：更新这个单元格值之前触发，<code>return false</code> 则不执行后续的更新。在编辑状态下修改了单元格之后，退出编辑模式并进行数据更新之前触发这个钩子。</li> <li>参数：
<ul><li>{Number} [r]: 单元格所在行数</li> <li>{Number} [c]: 单元格所在列数</li> <li>{Object | String | Number} [value]: 要修改的单元格内容</li> <li>{Boolean} [isRefresh]: 是否刷新整个表格</li></ul></li></ul> <hr> <h3 id="cellupdated"><a href="#cellupdated" class="header-anchor">#</a> cellUpdated</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：更新这个单元格后触发</li> <li>参数：
<ul><li>{Number} [r]: 单元格所在行数</li> <li>{Number} [c]: 单元格所在列数</li> <li>{Object} [oldValue]: 修改前的单元格对象</li> <li>{Object} [newValue]: 修改后的单元格对象</li> <li>{Boolean} [isRefresh]: 是否刷新整个表格</li></ul></li></ul> <hr> <h3 id="cellrenderbefore"><a href="#cellrenderbefore" class="header-anchor">#</a> cellRenderBefore</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：单元格渲染前触发，<code>return false</code> 则不渲染该单元格</li> <li>参数：
<ul><li>{Object} [cell]:单元格对象</li> <li>{Object} [position]:
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [c]:单元格所在列号</li> <li>{Number} [start_r]:单元格左上角的水平坐标</li> <li>{Number} [start_c]:单元格左上角的垂直坐标</li> <li>{Number} [end_r]:单元格右下角的水平坐标</li> <li>{Number} [end_c]:单元格右下角的垂直坐标</li></ul></li> <li>{Object} [sheet]:当前sheet对象</li> <li>{Object} [ctx]: 当前画布的context</li></ul></li></ul> <hr> <h3 id="cellrenderafter"><a href="#cellrenderafter" class="header-anchor">#</a> cellRenderAfter</h3> <ul><li><p>类型：Function</p></li> <li><p>默认值：null</p></li> <li><p>作用：单元格渲染结束后触发，<code>return false</code> 则不渲染该单元格</p></li> <li><p>参数：</p> <ul><li>{Object} [cell]:单元格对象</li> <li>{Object} [position]:
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [c]:单元格所在列号</li> <li>{Number} [start_r]:单元格左上角的水平坐标</li> <li>{Number} [start_c]:单元格左上角的垂直坐标</li> <li>{Number} [end_r]:单元格右下角的水平坐标</li> <li>{Number} [end_c]:单元格右下角的垂直坐标</li></ul></li> <li>{Object} [sheet]:当前sheet对象</li> <li>{Object} [ctx]: 当前画布的context</li></ul></li> <li><p>示例：</p> <p>一个在D1单元格的左上角和右下角分别绘制两张图的案例</p> <details class="custom-block details"><summary>DETAILS</summary> <div class="language-js extra-class"><pre class="language-js"><code>luckysheet<span class="token punctuation">.</span><span class="token function">create</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
        hook<span class="token operator">:</span> <span class="token punctuation">{</span>
            <span class="token function-variable function">cellRenderAfter</span><span class="token operator">:</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token parameter">cell<span class="token punctuation">,</span> position<span class="token punctuation">,</span> sheetFile<span class="token punctuation">,</span> ctx</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token keyword">var</span> r <span class="token operator">=</span> position<span class="token punctuation">.</span>r<span class="token punctuation">;</span>
                <span class="token keyword">var</span> c <span class="token operator">=</span> position<span class="token punctuation">.</span>c<span class="token punctuation">;</span>
                <span class="token keyword">if</span> <span class="token punctuation">(</span>r <span class="token operator">===</span> <span class="token number">0</span> <span class="token operator">&amp;&amp;</span> c <span class="token operator">===</span> <span class="token number">3</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment">// 指定处理D1单元格</span>
                    <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>window<span class="token punctuation">.</span>storeUserImage<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                        window<span class="token punctuation">.</span>storeUserImage <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
                    <span class="token punctuation">}</span>
					
                    <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>window<span class="token punctuation">.</span>storeUserImage<span class="token punctuation">[</span>r <span class="token operator">+</span> <span class="token string">'_'</span> <span class="token operator">+</span> c<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                        window<span class="token punctuation">.</span>storeUserImage<span class="token punctuation">[</span>r <span class="token operator">+</span> <span class="token string">'_'</span> <span class="token operator">+</span> c<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
                    <span class="token punctuation">}</span>

                    <span class="token keyword">var</span> img <span class="token operator">=</span> <span class="token keyword">null</span><span class="token punctuation">;</span>
                    <span class="token keyword">var</span> imgRight <span class="token operator">=</span> <span class="token keyword">null</span><span class="token punctuation">;</span>

                    <span class="token keyword">if</span> <span class="token punctuation">(</span>window<span class="token punctuation">.</span>storeUserImage<span class="token punctuation">[</span>r <span class="token operator">+</span> <span class="token string">'_'</span> <span class="token operator">+</span> c<span class="token punctuation">]</span><span class="token punctuation">.</span>image <span class="token operator">&amp;&amp;</span> window<span class="token punctuation">.</span>storeUserImage<span class="token punctuation">[</span>r <span class="token operator">+</span> <span class="token string">'_'</span> <span class="token operator">+</span> c<span class="token punctuation">]</span><span class="token punctuation">.</span>imgRight<span class="token punctuation">)</span> <span class="token punctuation">{</span>
						
						<span class="token comment">// 加载过直接取</span>
                        img <span class="token operator">=</span> window<span class="token punctuation">.</span>storeUserImage<span class="token punctuation">[</span>r <span class="token operator">+</span> <span class="token string">'_'</span> <span class="token operator">+</span> c<span class="token punctuation">]</span><span class="token punctuation">.</span>image<span class="token punctuation">;</span>
                        imgRight <span class="token operator">=</span> window<span class="token punctuation">.</span>storeUserImage<span class="token punctuation">[</span>r <span class="token operator">+</span> <span class="token string">'_'</span> <span class="token operator">+</span> c<span class="token punctuation">]</span><span class="token punctuation">.</span>imgRight<span class="token punctuation">;</span>

                    <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>

                        img <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Image</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        imgRight <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Image</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

                        img<span class="token punctuation">.</span>src <span class="token operator">=</span> <span class="token string">'https://www.dogedoge.com/favicon/developer.mozilla.org.ico'</span><span class="token punctuation">;</span>
                        imgRight<span class="token punctuation">.</span>src <span class="token operator">=</span> <span class="token string">'https://www.dogedoge.com/static/icons/twemoji/svg/1f637.svg'</span><span class="token punctuation">;</span>

						<span class="token comment">// 图片缓存到内存，下次直接取，不用再重新加载</span>
                        window<span class="token punctuation">.</span>storeUserImage<span class="token punctuation">[</span>r <span class="token operator">+</span> <span class="token string">'_'</span> <span class="token operator">+</span> c<span class="token punctuation">]</span><span class="token punctuation">.</span>image <span class="token operator">=</span> img<span class="token punctuation">;</span>
                        window<span class="token punctuation">.</span>storeUserImage<span class="token punctuation">[</span>r <span class="token operator">+</span> <span class="token string">'_'</span> <span class="token operator">+</span> c<span class="token punctuation">]</span><span class="token punctuation">.</span>imgRight <span class="token operator">=</span> imgRight<span class="token punctuation">;</span>

                    <span class="token punctuation">}</span>

					
                    <span class="token keyword">if</span> <span class="token punctuation">(</span>img<span class="token punctuation">.</span>complete<span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment">// 已经加载完成的直接渲染</span>
                        ctx<span class="token punctuation">.</span><span class="token function">drawImage</span><span class="token punctuation">(</span>img<span class="token punctuation">,</span> position<span class="token punctuation">.</span>start_c<span class="token punctuation">,</span> position<span class="token punctuation">.</span>start_r<span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
                        img<span class="token punctuation">.</span><span class="token function-variable function">onload</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                            ctx<span class="token punctuation">.</span><span class="token function">drawImage</span><span class="token punctuation">(</span>img<span class="token punctuation">,</span> position<span class="token punctuation">.</span>start_c<span class="token punctuation">,</span> position<span class="token punctuation">.</span>start_r<span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        <span class="token punctuation">}</span>

                    <span class="token punctuation">}</span>

                    <span class="token keyword">if</span> <span class="token punctuation">(</span>imgRight<span class="token punctuation">.</span>complete<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                        ctx<span class="token punctuation">.</span><span class="token function">drawImage</span><span class="token punctuation">(</span>imgRight<span class="token punctuation">,</span> position<span class="token punctuation">.</span>end_c <span class="token operator">-</span> <span class="token number">10</span><span class="token punctuation">,</span> position<span class="token punctuation">.</span>end_r <span class="token operator">-</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>

                        imgRight<span class="token punctuation">.</span><span class="token function-variable function">onload</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                            ctx<span class="token punctuation">.</span><span class="token function">drawImage</span><span class="token punctuation">(</span>imgRight<span class="token punctuation">,</span> position<span class="token punctuation">.</span>end_c <span class="token operator">-</span> <span class="token number">10</span><span class="token punctuation">,</span> position<span class="token punctuation">.</span>end_r <span class="token operator">-</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        <span class="token punctuation">}</span>
                    <span class="token punctuation">}</span>

                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre></div><p>:::</p></details></li></ul> <hr> <h3 id="cellallrenderbefore"><a href="#cellallrenderbefore" class="header-anchor">#</a> cellAllRenderBefore</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：所有单元格渲染之前执行的方法。在内部，这个方法加在了<code>luckysheetDrawMain</code>渲染表格之前。</li> <li>参数：
<ul><li>{Object} [data]: 当前工作表二维数组数据</li> <li>{Object} [sheet]:当前sheet对象</li> <li>{Object} [ctx]: 当前画布的context</li></ul></li></ul> <hr> <h3 id="rowtitlecellrenderbefore"><a href="#rowtitlecellrenderbefore" class="header-anchor">#</a> rowTitleCellRenderBefore</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：行标题单元格渲染前触发，<code>return false</code> 则不渲染行标题</li> <li>参数：
<ul><li>{String} [rowNum]:行号</li> <li>{Object} [position]:
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [top]:单元格左上角的垂直坐标</li> <li>{Number} [width]:单元格宽度</li> <li>{Number} [height]:单元格高度</li></ul></li> <li>{Object} [ctx]: 当前画布的context</li></ul></li></ul> <hr> <h3 id="rowtitlecellrenderafter"><a href="#rowtitlecellrenderafter" class="header-anchor">#</a> rowTitleCellRenderAfter</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：行标题单元格渲染后触发，<code>return false</code> 则不渲染行标题</li> <li>参数：
<ul><li>{String} [rowNum]:行号</li> <li>{Object} [position]:
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [top]:单元格左上角的垂直坐标</li> <li>{Number} [width]:单元格宽度</li> <li>{Number} [height]:单元格高度</li></ul></li> <li>{Object} [ctx]: 当前画布的context</li></ul></li></ul> <hr> <h3 id="columntitlecellrenderbefore"><a href="#columntitlecellrenderbefore" class="header-anchor">#</a> columnTitleCellRenderBefore</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：列标题单元格渲染前触发，<code>return false</code> 则不渲染列标题</li> <li>参数：
<ul><li>{Object} [columnAbc]:列标题字符</li> <li>{Object} [position]:
<ul><li>{Number} [c]:单元格所在列号</li> <li>{Number} [left]:单元格左上角的水平坐标</li> <li>{Number} [width]:单元格宽度</li> <li>{Number} [height]:单元格高度</li></ul></li> <li>{Object} [ctx]: 当前画布的context</li></ul></li></ul> <hr> <h3 id="columntitlecellrenderafter"><a href="#columntitlecellrenderafter" class="header-anchor">#</a> columnTitleCellRenderAfter</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：列标题单元格渲染后触发，<code>return false</code> 则不渲染列标题</li> <li>参数：
<ul><li>{Object} [columnAbc]:列标题字符</li> <li>{Object} [position]:
<ul><li>{Number} [c]:单元格所在列号</li> <li>{Number} [left]:单元格左上角的水平坐标</li> <li>{Number} [width]:单元格宽度</li> <li>{Number} [height]:单元格高度</li></ul></li> <li>{Object} [ctx]: 当前画布的context</li></ul></li></ul> <hr> <h2 id="鼠标钩子"><a href="#鼠标钩子" class="header-anchor">#</a> 鼠标钩子</h2> <h3 id="cellmousedownbefore"><a href="#cellmousedownbefore" class="header-anchor">#</a> cellMousedownBefore</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：单元格点击前的事件，<code>return false</code>则终止之后的点击操作</li> <li>参数：
<ul><li>{Object} [cell]:单元格对象</li> <li>{Object} [position]:
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [c]:单元格所在列号</li> <li>{Number} [start_r]:单元格左上角的水平坐标</li> <li>{Number} [start_c]:单元格左上角的垂直坐标</li> <li>{Number} [end_r]:单元格右下角的水平坐标</li> <li>{Number} [end_c]:单元格右下角的垂直坐标</li></ul></li> <li>{Object} [sheet]:当前sheet对象</li> <li>{Object} [ctx]: 当前画布的context</li></ul></li></ul> <hr> <h3 id="cellmousedown"><a href="#cellmousedown" class="header-anchor">#</a> cellMousedown</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：单元格点击后的事件，<code>return false</code>则终止之后的点击操作</li> <li>参数：
<ul><li>{Object} [cell]:单元格对象</li> <li>{Object} [position]:
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [c]:单元格所在列号</li> <li>{Number} [start_r]:单元格左上角的水平坐标</li> <li>{Number} [start_c]:单元格左上角的垂直坐标</li> <li>{Number} [end_r]:单元格右下角的水平坐标</li> <li>{Number} [end_c]:单元格右下角的垂直坐标</li></ul></li> <li>{Object} [sheet]:当前sheet对象</li> <li>{Object} [ctx]: 当前画布的context</li></ul></li></ul> <hr> <h3 id="sheetmousemove"><a href="#sheetmousemove" class="header-anchor">#</a> sheetMousemove</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：鼠标移动事件，可通过cell判断鼠标停留在哪个单元格</li> <li>参数：
<ul><li>{Object} [cell]:单元格对象</li> <li>{Object} [position]:
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [c]:单元格所在列号</li> <li>{Number} [start_r]:单元格左上角的水平坐标</li> <li>{Number} [start_c]:单元格左上角的垂直坐标</li> <li>{Number} [end_r]:单元格右下角的水平坐标</li> <li>{Number} [end_c]:单元格右下角的垂直坐标</li></ul></li> <li>{Object} [sheet]:当前sheet对象</li> <li>{Object} [moveState]:鼠标移动状态，可判断现在鼠标操作的对象，false和true
<ul><li>{Boolean} [functionResizeStatus]:工具栏拖动</li> <li>{Boolean} [horizontalmoveState]:水平冻结分割栏拖动</li> <li>{Boolean} [verticalmoveState]:垂直冻结分割栏拖动</li> <li>{Boolean} [pivotTableMoveState]:数据透视表字段拖动</li> <li>{Boolean} [sheetMoveStatus]:sheet改变你位置拖动</li> <li>{Boolean} [scrollStatus]:鼠标触发了滚动条移动</li> <li>{Boolean} [selectStatus]:鼠标移动框选数据</li> <li>{Boolean} [rowsSelectedStatus]:通过行标题来选择整行操作</li> <li>{Boolean} [colsSelectedStatus]:通过列标题来选择整列操作</li> <li>{Boolean} [cellSelectedMove]:选框的移动</li> <li>{Boolean} [cellSelectedExtend]:选框下拉填充</li> <li>{Boolean} [colsChangeSize]:拖拽改变列宽</li> <li>{Boolean} [rowsChangeSize]:拖拽改变行高</li> <li>{Boolean} [chartMove]:图表移动</li> <li>{Boolean} [chartResize]:图表改变大小</li> <li>{Boolean} [rangeResize]:公式参数高亮选区的大小拖拽</li> <li>{Boolean} [rangeMove]:公式参数高亮选区的位置拖拽</li></ul></li> <li>{Object} [ctx]: 当前画布的context</li></ul></li></ul> <hr> <h3 id="sheetmouseup"><a href="#sheetmouseup" class="header-anchor">#</a> sheetMouseup</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：鼠标按钮释放事件，可通过cell判断鼠标停留在哪个单元格</li> <li>参数：
<ul><li>{Object} [cell]:单元格对象</li> <li>{Object} [position]:
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [c]:单元格所在列号</li> <li>{Number} [start_r]:单元格左上角的水平坐标</li> <li>{Number} [start_c]:单元格左上角的垂直坐标</li> <li>{Number} [end_r]:单元格右下角的水平坐标</li> <li>{Number} [end_c]:单元格右下角的垂直坐标</li></ul></li> <li>{Object} [sheet]:当前sheet对象</li> <li>{Object} [moveState]:鼠标移动状态，可判断现在鼠标操作的对象，false和true
<ul><li>{Boolean} [functionResizeStatus]:工具栏拖动</li> <li>{Boolean} [horizontalmoveState]:水平冻结分割栏拖动</li> <li>{Boolean} [verticalmoveState]:垂直冻结分割栏拖动</li> <li>{Boolean} [pivotTableMoveState]:数据透视表字段拖动</li> <li>{Boolean} [sheetMoveStatus]:sheet改变你位置拖动</li> <li>{Boolean} [scrollStatus]:鼠标触发了滚动条移动</li> <li>{Boolean} [selectStatus]:鼠标移动框选数据</li> <li>{Boolean} [rowsSelectedStatus]:通过行标题来选择整行操作</li> <li>{Boolean} [colsSelectedStatus]:通过列标题来选择整列操作</li> <li>{Boolean} [cellSelectedMove]:选框的移动</li> <li>{Boolean} [cellSelectedExtend]:选框下拉填充</li> <li>{Boolean} [colsChangeSize]:拖拽改变列宽</li> <li>{Boolean} [rowsChangeSize]:拖拽改变行高</li> <li>{Boolean} [chartMove]:图表移动</li> <li>{Boolean} [chartResize]:图表改变大小</li> <li>{Boolean} [rangeResize]:公式参数高亮选区的大小拖拽</li> <li>{Boolean} [rangeMove]:公式参数高亮选区的位置拖拽</li> <li>{Boolean} [cellRightClick]:单元格右击</li> <li>{Boolean} [rowTitleRightClick]:行标题右击</li> <li>{Boolean} [columnTitleRightClick]:列标题右击</li> <li>{Boolean} [sheetRightClick]:底部sheet页右击</li> <li>{Boolean} [hyperlinkClick]:点击超链接</li></ul></li> <li>{Object} [ctx]: 当前画布的context</li></ul></li></ul> <hr> <h3 id="scroll"><a href="#scroll" class="header-anchor">#</a> scroll</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：鼠标滚动事件</li> <li>参数：
<ul><li>{Object} [position]:
<ul><li>{Number} [scrollLeft]:横向滚动条的位置</li> <li>{Number} [scrollTop]:垂直滚动条的位置</li> <li>{Number} [canvasHeight]:canvas高度</li></ul></li></ul></li></ul> <hr> <h3 id="celldragstop"><a href="#celldragstop" class="header-anchor">#</a> cellDragStop</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：鼠标拖拽文件到Luckysheet内部的结束事件</li> <li>参数：
<ul><li>{Object} [cell]:单元格对象</li> <li>{Object} [position]:
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [c]:单元格所在列号</li> <li>{Number} [start_r]:单元格左上角的水平坐标</li> <li>{Number} [start_c]:单元格左上角的垂直坐标</li> <li>{Number} [end_r]:单元格右下角的水平坐标</li> <li>{Number} [end_c]:单元格右下角的垂直坐标</li></ul></li> <li>{Object} [sheet]:当前sheet对象</li> <li>{Object} [ctx]: 当前画布的context</li> <li>{Object} [event]: 当前事件对象</li></ul></li></ul> <hr> <h2 id="选区操作-包括单元格"><a href="#选区操作-包括单元格" class="header-anchor">#</a> 选区操作（包括单元格）</h2> <h3 id="rangeselect"><a href="#rangeselect" class="header-anchor">#</a> rangeSelect</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：框选或者设置选区后触发</li> <li>参数：
<ul><li>{Object} [sheet]:当前sheet对象</li> <li>{Object | Array} [range]: 选区范围，可能为多个选区</li></ul></li></ul> <hr> <h3 id="rangemovebefore"><a href="#rangemovebefore" class="header-anchor">#</a> rangeMoveBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：移动选区前，包括单个单元格</li> <li>参数：
<ul><li>{Array} [range]: 当前选区范围，只能为单个选区</li></ul></li></ul> <hr> <h3 id="rangemoveafter"><a href="#rangemoveafter" class="header-anchor">#</a> rangeMoveAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：移动选区后，包括单个单元格</li> <li>参数：
<ul><li>{Array} [oldRange]: 移动前当前选区范围，只能为单个选区</li> <li>{Array} [newRange]: 移动后当前选区范围，只能为单个选区</li></ul></li></ul> <hr> <h3 id="rangeeditbefore"><a href="#rangeeditbefore" class="header-anchor">#</a> rangeEditBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区修改前</li> <li>参数：
<ul><li>{Object | Array} [range]: 选区范围，可能为多个选区</li> <li>{Object} [data]: 选区范围所对应的数据</li></ul></li></ul> <hr> <h3 id="rangeeditafter"><a href="#rangeeditafter" class="header-anchor">#</a> rangeEditAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区修改后</li> <li>参数：
<ul><li>{Object | Array} [range]: 选区范围，可能为多个选区</li> <li>{Object} [oldData]: 修改前选区范围所对应的数据</li> <li>{Object} [newData]: 修改后选区范围所对应的数据</li></ul></li></ul> <hr> <h3 id="rangecopybefore"><a href="#rangecopybefore" class="header-anchor">#</a> rangeCopyBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区复制前</li> <li>参数：
<ul><li>{Object | Array} [range]: 选区范围，可能为多个选区</li> <li>{Object} [data]: 选区范围所对应的数据</li></ul></li></ul> <hr> <h3 id="rangecopyafter"><a href="#rangecopyafter" class="header-anchor">#</a> rangeCopyAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区复制后</li> <li>参数：
<ul><li>{Object | Array} [range]: 选区范围，可能为多个选区</li> <li>{Object} [data]: 选区范围所对应的数据</li></ul></li></ul> <hr> <h3 id="rangepastebefore"><a href="#rangepastebefore" class="header-anchor">#</a> rangePasteBefore</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区粘贴前</li> <li>参数：
<ul><li>{Object | Array} [range]: 选区范围，可能为多个选区</li> <li>{Object} [data]: 要被粘贴的选区范围所对应的数据</li></ul></li></ul> <hr> <h3 id="rangepasteafter"><a href="#rangepasteafter" class="header-anchor">#</a> rangePasteAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区粘贴后</li> <li>参数：
<ul><li>{Object | Array} [range]: 选区范围，可能为多个选区</li> <li>{Object} [originData]: 要被粘贴的选区范围所对应的数据</li> <li>{Object} [pasteData]: 要粘贴的数据</li></ul></li></ul> <hr> <h3 id="rangecutbefore"><a href="#rangecutbefore" class="header-anchor">#</a> rangeCutBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区剪切前</li> <li>参数：
<ul><li>{Array} [range]: 选区范围，只能为单个范围</li> <li>{Object} [data]: 要被剪切的选区范围所对应的数据</li></ul></li></ul> <hr> <h3 id="rangecutafter"><a href="#rangecutafter" class="header-anchor">#</a> rangeCutAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区剪切后</li> <li>参数：
<ul><li>{Array} [range]: 选区范围，只能为单个范围</li> <li>{Object} [data]: 被剪切的选区范围所对应的数据</li></ul></li></ul> <hr> <h3 id="rangedeletebefore"><a href="#rangedeletebefore" class="header-anchor">#</a> rangeDeleteBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区删除前</li> <li>参数：
<ul><li>{Array} [range]: 选区范围，只能为单个范围</li> <li>{Object} [data]: 要被删除的选区范围所对应的数据</li></ul></li></ul> <hr> <h3 id="rangedeleteafter"><a href="#rangedeleteafter" class="header-anchor">#</a> rangeDeleteAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区删除后</li> <li>参数：
<ul><li>{Array} [range]: 选区范围，只能为单个范围</li> <li>{Object} [data]: 被删除的选区范围所对应的数据</li></ul></li></ul> <hr> <h3 id="rangeclearbefore"><a href="#rangeclearbefore" class="header-anchor">#</a> rangeClearBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区清除前</li> <li>参数：
<ul><li>{Object | Array} [range]: 选区范围，可能为多个选区</li> <li>{Object} [data]: 要被清除的选区范围所对应的数据</li></ul></li></ul> <hr> <h3 id="rangeclearafter"><a href="#rangeclearafter" class="header-anchor">#</a> rangeClearAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区清除后</li> <li>参数：
<ul><li>{Object | Array} [range]: 选区范围，可能为多个选区</li> <li>{Object} [data]: 被清除的选区范围所对应的数据</li></ul></li></ul> <hr> <h3 id="rangepullbefore"><a href="#rangepullbefore" class="header-anchor">#</a> rangePullBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区下拉前</li> <li>参数：
<ul><li>{Array} [range]: 当前选区范围，只能为单个范围</li></ul></li></ul> <hr> <h3 id="rangepullafter"><a href="#rangepullafter" class="header-anchor">#</a> rangePullAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：选区下拉后</li> <li>参数：
<ul><li>{Array} [range]: 下拉后的选区范围，只能为单个范围</li></ul></li></ul> <hr> <h2 id="工作表"><a href="#工作表" class="header-anchor">#</a> 工作表</h2> <h3 id="sheetcreatekbefore"><a href="#sheetcreatekbefore" class="header-anchor">#</a> sheetCreatekBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：创建sheet页前触发，sheet页新建也包含数据透视表新建</li></ul> <hr> <h3 id="sheetcreateafter"><a href="#sheetcreateafter" class="header-anchor">#</a> sheetCreateAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：创建sheet页后触发，sheet页新建也包含数据透视表新建</li> <li>参数：
<ul><li>{Object} [sheet]: 当前新创建的sheet页的配置</li></ul></li></ul> <hr> <h3 id="sheetmovebefore"><a href="#sheetmovebefore" class="header-anchor">#</a> sheetMoveBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：sheet移动前</li> <li>参数：
<ul><li>{Number} [i]: 当前sheet页的<code>index</code></li> <li>{Number} [order]: 当前sheet页<code>order</code></li></ul></li></ul> <hr> <h3 id="sheetmoveafter"><a href="#sheetmoveafter" class="header-anchor">#</a> sheetMoveAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：sheet移动后</li> <li>参数：
<ul><li>{Number} [i]: 当前sheet页的<code>index</code></li> <li>{Number} [oldOrder]: 修改前当前sheet页<code>order</code></li> <li>{Number} [newOrder]: 修改后当前sheet页<code>order</code></li></ul></li></ul> <hr> <h3 id="sheetdeletebefore"><a href="#sheetdeletebefore" class="header-anchor">#</a> sheetDeleteBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：sheet删除前</li> <li>参数：
<ul><li>{Object} [sheet]: 要被删除sheet页的配置</li></ul></li></ul> <hr> <h3 id="sheetdeleteafter"><a href="#sheetdeleteafter" class="header-anchor">#</a> sheetDeleteAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：sheet删除后</li> <li>参数：
<ul><li>{Object} [sheet]: 已被删除sheet页的配置</li></ul></li></ul> <hr> <h3 id="sheeteditnamebefore"><a href="#sheeteditnamebefore" class="header-anchor">#</a> sheetEditNameBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：sheet修改名称前</li> <li>参数：
<ul><li>{Number} [i]: sheet页的<code>index</code></li> <li>{String} [name]: 当前sheet页名称</li></ul></li></ul> <hr> <h3 id="sheeteditnameafter"><a href="#sheeteditnameafter" class="header-anchor">#</a> sheetEditNameAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：sheet修改名称后</li> <li>参数：
<ul><li>{Number} [i]: sheet页的index</li> <li>{String} [oldName]: 修改前当前sheet页名称</li> <li>{String} [newName]: 修改后当前sheet页名称</li></ul></li></ul> <hr> <h3 id="sheeteditcolorbefore"><a href="#sheeteditcolorbefore" class="header-anchor">#</a> sheetEditColorBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：sheet修改颜色前</li> <li>参数：
<ul><li>{Number} [i]: sheet页的<code>index</code></li> <li>{String} [color]: 当前sheet页颜色</li></ul></li></ul> <hr> <h3 id="sheeteditcolorafter"><a href="#sheeteditcolorafter" class="header-anchor">#</a> sheetEditColorAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：sheet修改颜色后</li> <li>参数：
<ul><li>{Number} [i]: sheet页的<code>index</code></li> <li>{String} [oldColor]: 修改前当前sheet页颜色</li> <li>{String} [newColor]: 修改后当前sheet页颜色</li></ul></li></ul> <hr> <h3 id="sheetzoombefore"><a href="#sheetzoombefore" class="header-anchor">#</a> sheetZoomBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：sheet缩放前</li> <li>参数：
<ul><li>{Number} [i]: sheet页的<code>index</code></li> <li>{String} [zoom]: 当前sheet页缩放比例</li></ul></li></ul> <hr> <h3 id="sheetzoomafter"><a href="#sheetzoomafter" class="header-anchor">#</a> sheetZoomAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：sheet缩放后</li> <li>参数：
<ul><li>{Number} [i]: sheet页的<code>index</code></li> <li>{String} [oldZoom]: 修改前当前sheet页缩放比例</li> <li>{String} [newZoom]: 修改后当前sheet页缩放比例</li></ul></li></ul> <hr> <h3 id="sheetactivate"><a href="#sheetactivate" class="header-anchor">#</a> sheetActivate</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：激活工作表前</li> <li>参数：
<ul><li>{Number} [i]: sheet页的<code>index</code></li> <li>{Boolean} [isPivotInitial]: 是否切换到了数据透视表页</li> <li>{Boolean} [isNewSheet]: 是否新建了sheet页</li></ul></li></ul> <hr> <h3 id="sheetdeactivatebefore"><a href="#sheetdeactivatebefore" class="header-anchor">#</a> sheetDeactivateBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：工作表从活动状态转为非活动状态前</li> <li>参数：
<ul><li>{Number} [i]: sheet页的<code>index</code></li></ul></li></ul> <hr> <h3 id="sheetdeactivateafter"><a href="#sheetdeactivateafter" class="header-anchor">#</a> sheetDeactivateAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：工作表从活动状态转为非活动状态后</li> <li>参数：
<ul><li>{Number} [i]: sheet页的<code>index</code></li></ul></li></ul> <hr> <h2 id="工作簿"><a href="#工作簿" class="header-anchor">#</a> 工作簿</h2> <h3 id="workbookcreatebefore"><a href="#workbookcreatebefore" class="header-anchor">#</a> workbookCreateBefore</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：表格创建之前触发。旧的钩子函数叫做<code>beforeCreateDom</code></li> <li>参数：
<ul><li>{Object} [book]: 整个工作簿的配置（options）</li></ul></li></ul> <hr> <h3 id="workbookcreateafter"><a href="#workbookcreateafter" class="header-anchor">#</a> workbookCreateAfter</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：表格创建之后触发</li> <li>参数：
<ul><li>{Object} [book]: 整个工作簿的配置（options）</li></ul></li></ul> <hr> <h3 id="workbookdestroybefore"><a href="#workbookdestroybefore" class="header-anchor">#</a> workbookDestroyBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：表格销毁之前触发</li> <li>参数：
<ul><li>{Object} [book]: 整个工作簿的配置（options）</li></ul></li></ul> <hr> <h3 id="workbookdestroyafter"><a href="#workbookdestroyafter" class="header-anchor">#</a> workbookDestroyAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：表格销毁之后触发</li> <li>参数：
<ul><li>{Object} [book]: 整个工作簿的配置（options）</li></ul></li></ul> <hr> <h3 id="updated"><a href="#updated" class="header-anchor">#</a> updated</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：协同编辑中的每次操作后执行的方法，监听表格内容变化，即客户端每执行一次表格操作，Luckysheet将这次操作存到历史记录中后触发，撤销重做时因为也算一次操作，也会触发此钩子函数。</li> <li>参数：
<ul><li>{Object} [operate]: 本次操作的历史记录信息，根据不同的操作，会有不同的历史记录，参考源码 <a href="https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/controlHistory.js" target="_blank" rel="noopener noreferrer">历史记录<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li></ul> <hr> <h3 id="resized"><a href="#resized" class="header-anchor">#</a> resized</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：resize执行之后</li> <li>参数：
<ul><li>{Object} [size]: 整个工作簿区域的宽高</li></ul></li></ul> <hr> <h2 id="图片"><a href="#图片" class="header-anchor">#</a> 图片</h2> <h3 id="imageinsertbefore"><a href="#imageinsertbefore" class="header-anchor">#</a> imageInsertBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：图片插入之前</li> <li>参数：
<ul><li>{Object} [url]: 图片地址</li></ul></li></ul> <hr> <h3 id="imageinsertafter"><a href="#imageinsertafter" class="header-anchor">#</a> imageInsertAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：图片插入之后</li> <li>参数：
<ul><li>{Object} [item]]: 图片地址、宽高、位置等信息</li></ul></li></ul> <hr> <h3 id="imageupdatebefore"><a href="#imageupdatebefore" class="header-anchor">#</a> imageUpdateBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：图片修改之前，修改的内容包括宽高、位置、裁剪等操作</li> <li>参数：
<ul><li>{Object} [item]]: 图片地址、宽高、位置等信息</li></ul></li></ul> <hr> <h3 id="imageupdateafter"><a href="#imageupdateafter" class="header-anchor">#</a> imageUpdateAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：图片修改之后，修改的内容包括宽高、位置、裁剪等操作</li> <li>参数：
<ul><li>{Object} [oldItem]]: 修改前图片地址、宽高、位置等信息</li> <li>{Object} [newItem]]: 修改后图片地址、宽高、位置等信息</li></ul></li></ul> <hr> <h3 id="imagedeletebefore"><a href="#imagedeletebefore" class="header-anchor">#</a> imageDeleteBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：图片删除之前</li> <li>参数：
<ul><li>{Object} [item]]: 图片地址、宽高、位置等信息</li></ul></li></ul> <hr> <h3 id="imagedeleteafter"><a href="#imagedeleteafter" class="header-anchor">#</a> imageDeleteAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：图片删除之后</li> <li>参数：
<ul><li>{Object} [item]]: 图片地址、宽高、位置等信息</li></ul></li></ul> <hr> <h2 id="批注"><a href="#批注" class="header-anchor">#</a> 批注</h2> <h3 id="commentinsertbefore"><a href="#commentinsertbefore" class="header-anchor">#</a> commentInsertBefore</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：插入批注之前，<code>return false</code> 则不插入批注</li> <li>参数：
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [c]:单元格所在列号</li></ul></li></ul> <hr> <h3 id="commentinsertafter"><a href="#commentinsertafter" class="header-anchor">#</a> commentInsertAfter</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：插入批注之后</li> <li>参数：
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [c]:单元格所在列号</li> <li>{Object} [cell]: 被插入批注所在的单元格信息，如：<code>{ r:0,c:2,v:{m:'233',v:'233'}}</code>，包含批注信息</li></ul></li></ul> <hr> <h3 id="commentdeletebefore"><a href="#commentdeletebefore" class="header-anchor">#</a> commentDeleteBefore</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：删除批注之前，<code>return false</code> 则不删除批注</li> <li>参数：
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [c]:单元格所在列号</li> <li>{Object} [cell]: 要删除的批注所在的单元格信息，如：<code>{ r:0,c:2,v:{m:'233',v:'233'}}</code>，可以看到批注信息</li></ul></li></ul> <hr> <h3 id="commentdeleteafter"><a href="#commentdeleteafter" class="header-anchor">#</a> commentDeleteAfter</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：删除批注之后</li> <li>参数：
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [c]:单元格所在列号</li> <li>{Object} [cell]: 被删除批注所在的单元格信息，如：<code>{ r:0,c:2,v:{m:'233',v:'233'}}</code>，可以看到批注已被删除</li></ul></li></ul> <hr> <h3 id="commentupdatebefore"><a href="#commentupdatebefore" class="header-anchor">#</a> commentUpdateBefore</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：修改批注之前，<code>return false</code> 则不修改批注</li> <li>参数：
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [c]:单元格所在列号</li> <li>{String} [value]: 新的批注内容</li></ul></li></ul> <hr> <h3 id="commentupdateafter"><a href="#commentupdateafter" class="header-anchor">#</a> commentUpdateAfter</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：修改批注之后</li> <li>参数：
<ul><li>{Number} [r]:单元格所在行号</li> <li>{Number} [c]:单元格所在列号</li> <li>{Object} [oldCell]: 修改前批注所在的单元格信息，如：<code>{ r:0,c:2,v:{m:'233',v:'233'}}</code></li> <li>{Object} [newCell]: 修改后批注所在的单元格信息，如：<code>{ r:0,c:2,v:{m:'233',v:'233'}}</code></li></ul></li></ul> <hr> <h2 id="数据透视表"><a href="#数据透视表" class="header-anchor">#</a> 数据透视表</h2> <h3 id="pivottableeditbefore"><a href="#pivottableeditbefore" class="header-anchor">#</a> pivotTableEditBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：修改数据透视表之前，操作如：拖动字段等</li> <li>参数：
<ul><li>{Object} [sheet]: 数据透视表所在sheet页配置</li></ul></li></ul> <hr> <h3 id="pivottableeditafter"><a href="#pivottableeditafter" class="header-anchor">#</a> pivotTableEditAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：修改数据透视表之后，操作如：拖动字段等</li> <li>参数：
<ul><li>{Object} [oldSheet]: 修改前数据透视表所在sheet页配置</li> <li>{Object} [newSheet]: 修改后数据透视表所在sheet页配置</li></ul></li></ul> <hr> <h2 id="冻结"><a href="#冻结" class="header-anchor">#</a> 冻结</h2> <h3 id="frozencreatebefore"><a href="#frozencreatebefore" class="header-anchor">#</a> frozenCreateBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：设置冻结前</li> <li>参数：
<ul><li>{Object} [frozen]: 冻结类型信息</li></ul></li></ul> <hr> <h3 id="frozencreateafter"><a href="#frozencreateafter" class="header-anchor">#</a> frozenCreateAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：设置冻结后</li> <li>参数：
<ul><li>{Object} [frozen]: 冻结类型信息</li></ul></li></ul> <hr> <h3 id="frozencancelbefore"><a href="#frozencancelbefore" class="header-anchor">#</a> frozenCancelBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：取消冻结前</li> <li>参数：
<ul><li>{Object} [frozen]: 冻结类型信息</li></ul></li></ul> <hr> <h3 id="frozencancelafter"><a href="#frozencancelafter" class="header-anchor">#</a> frozenCancelAfter</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：取消冻结后</li> <li>参数：
<ul><li>{Object} [frozen]: 冻结类型信息</li></ul></li></ul> <hr> <h2 id="打印"><a href="#打印" class="header-anchor">#</a> 打印</h2> <h3 id="printbefore"><a href="#printbefore" class="header-anchor">#</a> printBefore</h3> <p>（TODO）</p> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：打印前</li></ul> <hr> <h2 id="旧版钩子函数"><a href="#旧版钩子函数" class="header-anchor">#</a> 旧版钩子函数</h2> <h3 id="firemousedown"><a href="#firemousedown" class="header-anchor">#</a> fireMousedown</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：单元格数据下钻自定义方法，注意此钩子函数是挂载在options下：<code>options.fireMousedown</code></li></ul> <hr> <h2 id="分页器"><a href="#分页器" class="header-anchor">#</a> 分页器</h2> <h3 id="ontogglepager"><a href="#ontogglepager" class="header-anchor">#</a> onTogglePager</h3> <ul><li>类型：Function</li> <li>默认值：null</li> <li>作用：点击分页按钮回调函数，返回当前页码，具体参数参照<a href="https://github.com/jvbei/sPage" target="_blank" rel="noopener noreferrer">sPage backFun<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li>参数：
<ul><li>{Object} [page]: 返回当前分页对象</li></ul></li></ul> <hr></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/mengshukeji/Luckysheet/edit/master/docs/zh/guide/config.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">1/19/2021, 1:33:53 AM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/LuckysheetDocs/zh/guide/" class="prev router-link-active">
        快速上手
      </a></span> <span class="next"><a href="/LuckysheetDocs/zh/guide/sheet.html">
        工作表配置
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/LuckysheetDocs/assets/js/app.02d9598d.js" defer></script><script src="/LuckysheetDocs/assets/js/2.daa13025.js" defer></script><script src="/LuckysheetDocs/assets/js/29.1ae5f953.js" defer></script>
  </body>
</html>
